.tstable-container {
  position: relative;
  overflow: hidden;

  &:hover {
    .btn-setting {
      opacity: 1;
    }
  }

  .btn-setting {
    position: absolute;
    top: 0px;
    right: 0;
    z-index: 9;

    .icon-setting {
      padding: 9px 9px;
      padding-right: 25px;
      cursor: pointer;
      display: block;
    }
  }

  .tstable-main {
    overflow: auto;
    min-height: 100px;
  }
  .table-top{
    position: relative;
    z-index:9;
    tbody tr td,tbody tr th{
      height: 0;
      overflow: hidden;
      padding-top: 0;
      padding-bottom: 0;
      border-bottom: 0 none !important;
      line-height: 0;
      >*{
        height: 0 !important;
        overflow: hidden;
        margin-top: 0;
        margin-bottom: 0;
        border-top: 0 none !important;
        border-bottom: 0 none !important;
      }
    }
  }
  .table-main{
    thead tr th{
      height: 0;
      overflow: hidden;
      padding-top: 0;
      padding-bottom: 0;
      border-bottom: 0 none !important;
      line-height: 0;
      >*{
        height: 0 !important;
        overflow: hidden;
        margin-top: 0;
        margin-bottom: 0;
        border-top: 0 none !important;
        border-bottom: 0 none !important;
      }
    }    
  }
  .tstable-body {
    min-width: 100%;
    text-align: left;
    min-width: 100%;
    text-align: left;
    border-collapse: collapse;
    border-spacing: 0;

    th,
    td {
      padding: 9px;
      font-weight: normal;
    }

    th {
      white-space: nowrap;
      word-break: keep-all;
      height: 38px;
      position: relative;
      -webkit-backface-visibility: hidden;
      -moz-backface-visibility: hidden;
      -ms-backface-visibility: hidden;
      backface-visibility: hidden;
      -webkit-perspective: 1000px;
      -moz-perspective: 1000px;
      -ms-perspective: 1000px;
      perspective: 1000px;
      transition: none;
      perspective: 1000px;
      will-change: transform;


      .btn-resize {
        position: absolute;
        top: 0;
        right: 0;
        width: 8px;
        height: 100%;
        cursor: col-resize;

        &:after {
          content: '';
          position: absolute;
          top: 0;
          right: 0;
          width: 1px;
          height: 100%;
        }
      }
    }

    td {
      white-space: nowrap;
      word-break: keep-all;
    }

    tbody {
      tr {
        transition: opacity ease 0.3s;
        .action-div {
          position: absolute;
          z-index: 2;
          top: 0;
          bottom: 0;
          right: 24px;
          display: none;
        }
        &:hover {
          .tstable-action {
            z-index: 99;

            .tstable-action-ul {
              opacity: 1;
              right: 0;
            }
          }

          .action-tr {
            z-index: 7;
            position: relative;
            opacity: 1;
          }

          .action-bgimg {
            display: block;
          }
          .btn-hideaction {
            display: block;
          }

          .action-div {
            display: block;
          }

        }
      }
    }

    .action-tr {
      opacity: 0;
      .action-bgimg {
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        right: -8px;
        filter: blur(4px);

        &:before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          bottom: 0;
          right: 0;
        }
      }
      .btn-hideaction {
        position: absolute;
        top: 0;
        height: 100%;
        width: 24px;
        left: 0;
        display: none;
        cursor: pointer;
        overflow: hidden;
        &:hover {
          .btn-hideicon {
            opacity: 1;
          }
        }
        .btn-hideicon {
          position: absolute;
          top: 50%;
          right: 0;
          height: 18px;
          line-height: 18px;
          margin-top: -9px;
          width: 24px;
          text-align: center;
          font-size: 16px;
          transition: all 0.3s;
          &:before {
            margin-right: 0;
          }
          opacity: 0.4;
        }
      }
      &.hideAction {
        .tstable-action-ul {
          opacity: 0 !important;
          width: 0;
          overflow: hidden;
        }
        .btn-hideaction {
          .btn-hideicon {
            transform: rotate(180deg);
          }
        }
        .action-bgimg {
          width: 0 !important;
        }
      }
    }

    .tstable-selection {
      width: 16px;
      height: 16px;
      display: block;
      margin-right: 4px;
      margin-left: 4px;
      position: relative;
      display: inline-block;

      &:hover {
        cursor: pointer;
      }

      &.selected {
        &:after {
          content: '';
          width: 11px;
          height: 6px;
          position: absolute;
          top: 50%;
          left: 50%;
          border-radius: 2px;
          transform: rotate(-45deg);
          margin-top: -5px;
          margin-left: -6px;
        }
      }

      &.disabled {
        opacity: 0.9;

        &:hover {
          cursor: not-allowed;
        }
      }

      &.some {
        &:after {
          content: '';
          width: 8px;
          height: 2px;
          position: absolute;
          top: 50%;
          left: 50%;
          margin-top: -1px;
          margin-left: -4px;
          border: 0 none;
          transform: none;
        }
      }
    }

    .tstable-action {
      width: 0;
      position: absolute;
      top: 0;
      bottom: 0;
      float: right;

      .tstable-action-ul {
        position: absolute;
        top: 50%;
        list-style: none;
        margin-top: -18px;
        display: block;
        opacity: 0;
        right: 0px;

        li {
          list-style: none;
          padding: 8px 16px;
          display: inline-block;
          cursor: pointer;
          position: relative;

          &.disable {
            cursor: not-allowed;
          }

          &:before {
            margin-right: 4px;
          }

          &:not(:last-of-type) {
            &:after {
              content: '|';
              position: absolute;
              top: 9px;
              right: 0;
              opacity: 0.4;
            }
          }

          .icon:before {
            padding-right: 8px;
          }
        }
      }
    }

    &.tstable-small {
      th,
      td {
        padding: 6px;
      }

      .tstable-action {
        .tstable-action-ul {
          margin-top: -14px;

          li {
            padding: 4px;

            &:not(:last-of-type) {
              &:after {
                top: 6px;
              }
            }
          }
        }
      }
    }

    &.tstable-noborder {
      td {
        border-bottom: 0 none;
      }
    }
  }
}

.tstable-page {
  text-align: right;
  padding-top: 10px;
  background-color: transparent !important;
}

.sort-container {
  position: relative;
  padding-top: 30px;

  .sort-thead {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  .sort-item {
    position: relative;
  }

  .sort-item,
  .sort-thead {
    padding-left: 32px;
    padding-right: 34px;
    line-height: 30px;
    height: 30px;

    .sort-handle {
      position: absolute;
      left: 0;
      top: 0;
      width: 32px;
      text-align: center;
    }

    .sort-show {
      position: absolute;
      right: 0;
      top: 0;
      width: 34px;
      text-align: center;
    }
  }

  .sort-item {
    &.disabled {
      display: none;
    }

    .sort-handle {
      cursor: ns-resize;
    }
  }

  .sort-group {
    overflow: auto;
    max-height: 300px;
  }
}
.sort-drop .ivu-poptip-body {
  padding: 4px;
}
.tstable-page {
  .ivu-select-selection {
    border: none !important;
  }
}
.tstable-action {
  .ivu-table-cell {
    overflow: visible;
    position: relative;
    padding: 0;
  }
}

.tableaction-container {
  width: 0;

  .table-dropdown {
    padding: 0;
    margin: 0;
    box-shadow: none;
    top: 0;
    right: 100%;
    display: none;

    .ivu-dropdown-menu {
      word-break: keep-all;
      white-space: nowrap;
      display: block;
      min-width: auto;

      .ivu-dropdown-item {
        display: inline-block;
        padding: 0 10px;
        position: relative;

        &:not(:last-of-type) {
          &:after {
            content: '';
            width: 1px;
            height: 14px;
            top: 50%;
            margin-top: -7px;
            right: 0;
            position: absolute;
          }
        }

        &:hover {
          background: transparent;
        }
      }
    }
  }
}
